#include <stdio.h>
int isLeapYear(int year)
{
    return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}

int allDays(int year, int month, int day)
{
    int days = 0;
    int months[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for (int i = 1980; i < year; i++)
    {
        days += isLeapYear(i) ? 366 : 365;
    }
    if (isLeapYear(year))
    {
        months[1] = 29;
    }
    for (int i = 0; i < month - 1; i++)
    {
        days += months[i];
    }
    days += day;
    return days;
}
int main()
{
    int y,m,d;
    scanf("%d-%d-%d", &y,&m,&d);
    switch(allDays(y,m,d)%7)
    {
       case 1:printf("Tuesday");break;
       case 2:printf("Wednesday");break;
       case 3:printf("Thursday");break;
       case 4:printf("Friday");break;
       case 5:printf("Saturday");break;
       case 6:printf("Sunday");break;
       case 0:printf("Monday");break;
    }
    return 0;
}
